<!-- 通知模块 -->
<!-- <div class="modal fade" id="infoModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> -->
<div class="modal-dialog" id="infoWindow">
	<div class="modal-content">
		<div class="modal-header">
			<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
			<h3 id="myModalLabel">通知</h3>
		</div>
		<div class="modal-body">
			<table class="table table-bordered table-striped">
				<tr style="background-color: fefefe;">
					<td>
						<div class="m-list" style="height: 400px;">
							<ul id="info_ul">
								<!--v-for-start-->
								<li class="add_li" v-for="af in afList">
									<div style="float: left; padding-right: 10px;">
										<img style="width: 50px; height: 50px;" :src="af.addUser.uimage">
									</div>
									<div style="float: right; margin-top: 8px;" class="info_btn_div">
										<button class="btn btn-success" @click="infoAgree(af.addfId)">同意</button>
										<button class="btn btn-danger" @click="infoIgnore(af.addfId)">忽略</button>
									</div> <span style="font-size: 18px;" v-text="af.addUser.nickName">小林</span><br />
									<span style="color: #ccc;">对方申请添加您为好友&nbsp;uid:<span v-text="af.addUser.uid">10001</span></span>
								</li>
								<!--v-for-end-->
								<li v-if="afList.length == 0" style="color: #ccc;font-size: 20px;text-align: center" @click="getAddInfo()">无消息,点击刷新!</li>
							</ul>
						</div>
					</td>
				</tr>

			</table>
		</div>
		<div class="modal-footer">
			<!-- <button class="btn btn-success" id="addSubmit" data-dismiss="modal" aria-hidden="true">保存</button> -->
			<button class="btn btn-default" data-dismiss="modal" aria-hidden="true">关闭</button>
		</div>
	</div>
</div>
<!-- </div> -->

<script type="text/javascript">
	var infoWindow = new Vue({
		el: '#infoWindow',
		data: {
			afList: []
		},
		created() {
			this.getAddInfo();
		},
		methods: {
			//获取系统消息(好友申请)
			getAddInfo() {
				getAddInfo().then(res => {
					if (res.data.errno == 0) {
						this.afList = res.data.data;
						//更新系统消息条数
						vm.infoNum = this.afList.length;
					}
					errInfo(res);
				})
			},
			/*同意申请*/
			infoAgree(id) {
				infoAgree(id).then(res => {
					if (res.data.errno == 0) {
						this.getAddInfo();
						vm.refreshFriend();
					}
					errInfo(res, true);
				})
			},

			/*忽略申请*/
			infoIgnore(id) {
				infoIgnore(id).then(res => {
					this.getAddInfo();
					errInfo(res);
				});
			}
		}
	})
</script>